package doantotnghiep.business;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import doantotnghiep.dao.ProviderDao;
import doantotnghiep.model.Provider;

public class ProviderBusiness {

	@Autowired
	private ProviderDao providerDao;

	public Provider getProviderById(int id) {
		return providerDao.findProviderByID(id);
	}

	public List<Provider> listProvider() {
	 System.out.println("hello");
		return providerDao.listProvider();
	}

	public void addProvider(Provider provider) {
		providerDao.addProvider(provider);
	}

	public void saveProviderChanged(Provider provider) {
		providerDao.saveProvider(provider);
	}

	public void deleteProvider(int id) {
		providerDao.deleteProvider(id);
	}

	public List<Provider> getListProviderByKey(String key) {
		return providerDao.getProviderByKey(key);	
	}
}
